home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / pdox693.zip / TI1190.ASC < prev    next >
Text File  |  1992-11-12  |  5KB  |  199 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox                               NUMBER  :  1190
  9.   VERSION  :  All
  10.        OS  :  DOS
  11.      DATE  :  November 12, 1992                        PAGE  :  1/3
  12.  
  13.     TITLE  :  Creating a crosstab with non-numeric data
  14.  
  15.  
  16.  
  17.  
  18.   In order to create a Crosstab table, Paradox needs numerical data
  19.   to summarize.  Some tables might not have numeric fields to work
  20.   with, so it is necessary to create a numeric field in order to
  21.   produce a Crosstab table.  The table below called "Customer" is a
  22.   list of customers, products that they have purchased, and what
  23.   form of advertising brought them to the store to purchase that
  24.   product.  The table "Customer" is in normalized form - the values
  25.   TV ad, Radio ad, and Friend are values in one field (Referred by)
  26.   rather than separate fields themselves (which would be a non-
  27.   normalized form).  For information on table normalization refer
  28.   to TI 124 and TI 127.
  29.  
  30.  
  31.   Customer═╦══Name══╦═Product═╦═Referred by═╗
  32.            ║ Dave   ║ VCR     ║ TV ad       ║
  33.            ║ Dave   ║ TV      ║ TV ad       ║
  34.            ║ John   ║ TV      ║ Radio ad    ║
  35.            ║ Kevin  ║ Camera  ║ Radio ad    ║
  36.            ║ Nadine ║ VCR     ║ Friend      ║
  37.            ║ Cindy  ║ VCR     ║ Friend      ║
  38.            ║ Norm   ║ TV      ║ TV ad       ║
  39.            ║ Mike   ║ VCR     ║ TV ad       ║
  40.            ║ Cal    ║ TV      ║ Radio ad    ║
  41.            ║ Aileen ║ VCR     ║ TV ad       ║
  42.            ║ Dan    ║ Camera  ║ Friend      ║
  43.  
  44.  
  45.   From the table above, suppose we want to create a Crosstab which
  46.   has all of the different "Product" values as its rows, all of the
  47.   different "Referred by" values as its columns, and the count of
  48.   how many times a product was referred by each advertising
  49.   category.
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Paradox                               NUMBER  :  1190
  75.   VERSION  :  All
  76.        OS  :  DOS
  77.      DATE  :  November 12, 1992                        PAGE  :  2/3
  78.  
  79.     TITLE  :  Creating a crosstab with non-numeric data
  80.  
  81.  
  82.  
  83.  
  84.   Part I:  Create a numeric field to summarize crosstab data.
  85.  
  86.  
  87.   Create a numeric field to summarize crosstab data by performing
  88.   the following query.
  89.  
  90.  
  91.   Customer═╦══Name══╦═Product═╦════Referred by════╗
  92.            ║        ║√+       ║√+calc 1 as Dummy  ║
  93.            ║        ║         ║                   ║
  94.  
  95.  
  96.   The "√+" is produced by pressing <Alt-F6>.  This query creates
  97.   the following Answer table:
  98.  
  99.  
  100.   Answer═╦═Product═╦═Referred by═╦═Dummy═╗
  101.          ║ VCR     ║ TV ad       ║    1  ║
  102.          ║ TV      ║ TV ad       ║    1  ║
  103.          ║ TV      ║ Radio ad    ║    1  ║
  104.          ║ Camera  ║ Radio ad    ║    1  ║
  105.          ║ VCR     ║ Friend      ║    1  ║
  106.          ║ VCR     ║ Friend      ║    1  ║
  107.          ║ TV      ║ TV ad       ║    1  ║
  108.          ║ VCR     ║ TV ad       ║    1  ║
  109.          ║ TV      ║ Radio ad    ║    1  ║
  110.          ║ VCR     ║ TV ad       ║    1  ║
  111.          ║ Camera  ║ Friend      ║    1  ║
  112.  
  113.  
  114.  
  115.   Part II:  Crosstab the Answer table
  116.  
  117.  
  118.   To produce the Crosstab:
  119.  
  120.      1.  Select  <F10> | Image | Graph | Crosstab | Count.
  121.  
  122.      2.  Move to the column that contains the row values (i.e. the
  123.          Product field), then press <Enter>.
  124.  
  125.      3.  Move to the column that contains the column labels (i.e.
  126.          the Referred by field), then press <Enter>.
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.   PRODUCT  :  Paradox                               NUMBER  :  1190
  141.   VERSION  :  All
  142.        OS  :  DOS
  143.      DATE  :  November 12, 1992                        PAGE  :  3/3
  144.  
  145.     TITLE  :  Creating a crosstab with non-numeric data
  146.  
  147.  
  148.  
  149.  
  150.      4.  Move to the field that contains the numerical data (i.e.
  151.          the Dummy field), then press <Enter>.
  152.  
  153.  
  154.   The following Crosstab table is created:
  155.  
  156.  
  157.   Crosstab═╦═Product═╦═TV ad═╦═Radio ad═╦═Friend═╗
  158.            ║ Camera  ║    0  ║       1  ║     1  ║
  159.            ║ TV      ║    2  ║       2  ║     0  ║
  160.            ║ VCR     ║    3  ║       0  ║     2  ║
  161.  
  162.  
  163.   Part III:  (Optional) Reversing the row and column labels
  164.  
  165.  
  166.   To have the row and column labels reversed, perform the steps
  167.   below:
  168.  
  169.      1.  After performing the query in Part I on page 2 of this
  170.          Technical Information sheet, move the cursor to the
  171.          Product field and press <Ctrl-R> to rotate the fields.
  172.  
  173.      2.  Rotate the fields one more time by moving to the Dummy
  174.          field and pressing <Ctrl-R>.
  175.  
  176.      3.  Now the two fields Product and Referred by are reversed
  177.          and you can proceed with crosstabbing the Answer table
  178.          (follow the steps in outlined Part II on page 2 of this
  179.          Technical Information sheet).
  180.  
  181.   DISCLAIMER: You have the right to use this technical information
  182.   subject to the terms of the No-Nonsense License Statement that
  183.   you received with the Borland product to which this information
  184.   pertains.
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.